unit Downloader;

interface

  uses
    ExtActns;

  type
    TDownloader = class
      private
        fDownloadURL : TDownloadURL;
      public
        constructor Create(URL, Destination : WideString);
    end;

  //procedure URL_OnDownloadProgress(Sender : TDownloadURL; Progress, ProgressMax : Cardinal; StatusCode : TURLDownloadStatus; StatusText : String; var Cancel : Boolean);

implementation

  constructor TDownloader.Create(URL, Destination: WideString);
    procedure URL_OnDownloadProgress(Send : TDownloadURL; Progress, ProgressMax : Cardinal; StatusCode : TURLDownloadStatus; StatusText : String; var Cancel : Boolean); inline;
    begin
      //
    end;
  begin
    try
      fDownloadURL := TDownloadURL.Create(Self);
      fDownloadURL.URL := URL;
      fDownloadURL.Filename := Destination;
      fDownloadURL.OnDownloadProgress := URL_OnDownloadProgress;
      fDownloadURL.ExecuteTarget(nil);
    finally
      fDownloadURL.Free();
    end;
  end;



end.
